package cn.sxt.service.impl;

import cn.sxt.domain.Topic;
import cn.sxt.mapper.TopicMapper;
import cn.sxt.service.TopicService;
import cn.sxt.utils.DataGridView;
import cn.sxt.vo.TopicVo;

import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author lij
 * @since 2018-10-08
 */
@Service
public class TopicServiceImpl extends ServiceImpl<TopicMapper, Topic> implements TopicService {

	@Autowired
	private TopicMapper topicMapper;
	
	@Override
	public DataGridView queryAllTopic(TopicVo topicVo) {
		Pagination pagination=new Pagination(topicVo.getPage(), topicVo.getRows());
		List<Topic> list = topicMapper.queryAllTopic(pagination, topicVo);
		return new DataGridView(pagination.getTotal(), list);
	}

}
